The Microsoft Internet Explorer web browser includes an HTML engine that draws or renders a web page on a computer display based upon a hyper-text markup language (HTML) file and other included resources that define the web page. Among other elements, these web pages can contain tables that are automatically sized to the available display area.
In auto-sizing HTML table elements, the HTML engine calls a table sizing method (TSM) that determines the table's dimensions and renders the table in the display. The HTML engine gives the TSM an area in which the table may be rendered. The TSM must determine a width for each column in the table so that all columns will fit within the designated area. However, each table cell within a column may have a range of acceptable widths. In FIG. 1, the range of acceptable widths for each table cell begins at a minimum acceptable width 101 and ends at a maximum acceptable width 151.
The TSM requests a minimum and maximum acceptable width for each table cell from a table cell sizing method (TCSM). The TCSM determines the maximum acceptable cell width by flowing the text and graphical content into the table cell with the width set at infinity 101. In horizontal character flow table cells, the width is used by the TCSM to determine how far to let characters flow horizontally from left to right before starting the next horizontal line. With the table cell width set at infinity, each paragraph in the cell is flowed into a separate horizontal line 152. Accordingly, the table cell maximum acceptable width Is generally defined as the width 151 of the longest paragraph when each word of that paragraph is placed in one horizontal line 152.
The TCSM next determines the minimum acceptable cell width by flowing the characters into a cell with the width set to zero 100. At zero width, each word in the cell content is forced onto a separate horizontal line 104. This creates a horizontal line for each word in the cell content. The table cell minimum acceptable width is generally defined as the width of the longest word 102.
Based on these determined minimum 101 and maximum 151 acceptable widths for each individual cell within a column, the TSM will be able to propose a width for that column. The TSM then asks the TCSM to render each table cell within the column at the proposed width (P) 171. The TCSM flows the content into the table cell at the proposed width P 171. The TCSM then measures the resulting height (H) 181 and width (W) 180 of the cell.
A problem arises with this prior table sizing solution, because some foreign languages have vertical character flow instead of horizontal character flow. The existing table cell methodology which was designed for horizontal text 103 does not adequately handle vertical character flow.
In FIG. 1a, table cells with the vertical character flow property, flow from top to bottom 21, instead of from left to right. Therefore, the computation of minimum and maximum acceptable cell widths as performed by the TCSM is incorrect.
Specifically, upon the advent of table cells with the vertical character flow property, the table cells now flow from top to bottom instead of from left to right. Therefore the width input measurements (i.e., infinity, zero, and P) used by the TCSM to control how far table cells flow in the horizontal ‘width’ direction no longer make sense. Table cells with the vertical character flow property need to know how far to flow characters in the vertical character flow direction 21. Again, vertical table cells need to know the distance to flow characters in the vertical direction.
When the TSM asks the TCSM for minimum and maximum acceptable cell widths for a table cell with the vertical character flow property, the measurements returned by the TCSM are wrong. First, in FIG. 1a, when computing a maximum acceptable table cell width with the existing methodology, the TSM calls the TCSM with the width at infinity. The vertical table cell interprets this as a request to vertically flow the table cell for a character flow distance(CFD) 22 equal to infinity. Since the character flow direction 21 is vertical, each paragraph in the content is flowed into a single vertically line. This creates a smaller table cell width 19, not the desired maximum acceptable table cell width.
Second, when computing a minimum acceptable table cell width, the TSM calls the TCSM with the width set at zero. The vertical table cell interprets this as a request to flow the vertical table cell with the character flow distance (CFD) 33 equal to zero. With the CFD set at zero, a new vertical line is forced after each character. This creates a very wide table cell width 29, not the desired minimum acceptable table cell width. Therefore, the TCSM is unable to measure the necessary minimum and maximum acceptable table cell widths.
Further, without these determined minimum and maximum acceptable widths for each individual cell within a column 19, 29, the TSM will be unable to propose a width for that column 43.
However, the existing methodology fails for at least one more reason. Even if the TSM could propose a width P 43, without knowing the minimum 29 and maximum 19 acceptable table cell widths, the TCSM could not use the proposed P anyway. P does not tell the TCSM how far to flow characters in the character flow direction. The TSM needs to know a CFD 42 in order to know how far to flow the characters in the table cell, and the proposed P 43 does not provide the needed CFD measurement 42. This was not a problem with horizontal table cells because as shown in FIG. 1, the TCSM was designed to use the proposed P 171 to determine how far characters should flow horizontally.
The invention offers a way to auto-size vertical table cells. The illustrated embodiment of the invention solves these problems and is able to auto-size table cell elements with the vertical character flow property. Further, the illustrated embodiment auto-sizes tables that contain table cells with both the vertical and the horizontal character flow property. The embodiment of the invention illustrated herein is called the vertical oriented method (VOM).
The VOM achieves the layout of HTML elements with the vertical character flow property. The VOM addresses this problem with a switch in logical perspective. The target element with the vertical character flow property is logically viewed at an angle rotated 90° clockwise. As shown in FIG. 2, physical width (W) 201 becomes logical height (LH) 252, and physical height (H) 202 becomes logical width (LW) 251.
The auto-sizing of HTML elements according to the VOM, produces either left-to-right HTML rectangle area layouts, or top-to-bottom layouts using a shared table sizing routine.
Additional features and advantages of the invention will be made apparent from the following detailed description of the VOM which proceeds with reference to the accompanying drawings.